package com.phpxiu.app.model;


import android.content.Context;

import com.phpxiu.app.config.HttpConfig;
import com.phpxiu.app.kkylive.R;

/**
 * @file
 * @brief 通用分享内容结构
 * @author 吴金洲
 * @note 通用分享内容结构，
 *
 */
public class ShareContent {
    private Context context;
    private String _title;
    /**
     * 分享标题，新浪微博没有标题项，微信和QQ此项不能为null，否则SDK无法调用
     */
    private String title;
    /**
     * 分享内容描述,微信和QQ此项不能为null,否则SDK无法调用
     */
    private String summary;
    /**
     * 分享内容描述
     */
    private String linkSummary;
    /**
     * 分享图片地址
     */
    private String imageUrl;
    /**
     * 分享内容点击时跳转连接必须，且为http开头的地址
     */
    private String targetUrl= HttpConfig.HOME;

    public ShareContent(Context c) {
        context = c;
    }

    public String getTitle() {
        return title;
    }

    public String get_title() {
        return _title;
    }

    public void setTitle(String title) {
        _title=title;
        this.title = String.format(context.getString(R.string.share_title),title);
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = String.format(context.getString(R.string.share_summary),summary);
    }

    public String getLinkSummary() {
        return linkSummary;
    }

    public void setLinkSummary(String summary,String link) {
        this.linkSummary = String.format(context.getString(R.string.share_link_summary),summary,link);
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public String getTargetUrl() {
        return targetUrl;
    }

    public void setTargetUrl(String targetUrl) {
        this.targetUrl = targetUrl;
    }

    public void release(){
        context=null;
    }
}
